<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
    <%@page import="support.*, java.util.*, java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Specialization</title>
</head>
<body>


<%= session.getAttribute("firstNameSes") %>
<%= session.getAttribute("middleInitialSes") %>
<%= session.getAttribute("lastNameSes") %><br>
Citizen of <%= session.getAttribute("citizenSes") %><br>
Resident of <%= session.getAttribute("residentSes") %><br>
Address: <%= session.getAttribute("streetSes") %><br>
City: <%= session.getAttribute("citySes") %><br>
<%
if( session.getAttribute("stateSes") != null )
{ %>
	State: <%= session.getAttribute("stateSes") %><br>
<%
}
else
{ %>
	Country Code: <%= session.getAttribute("countryCodeSes") %><br>
	
<% } %>
Zip: <%= session.getAttribute("zipSes") %><br>
Phone Number: (<%= session.getAttribute("areaCodeSes") %>) <%= session.getAttribute("phoneSes") %><br>
<br>

<%
if ( session.getAttribute("permanentResident") != null)
{ %>
	Domestic Status: <%= session.getAttribute("permanentResident") %><br><br>
<% } 

Vector degreeInfo = (Vector) session.getAttribute( "degreeInfoSes" );

for( int i = 0; i< degreeInfo.size(); i=i+8 )
{ %>
	University: <%= ((Vector)session.getAttribute("degreeInfoSes")).elementAt(i+6) %><br>
	Major: <%= ((Vector)session.getAttribute("degreeInfoSes")).elementAt(i+7) %><br>
	Date degree Received: <%= ((Vector)session.getAttribute("degreeInfoSes")).elementAt(i+2) %><br>
	GPA: <%= ((Vector)session.getAttribute("degreeInfoSes")).elementAt(i+3) %><br>
	Degree Type: <%= ((Vector)session.getAttribute("degreeInfoSes")).elementAt(i+4) %><br>
	Resume: <%= ((Vector)session.getAttribute("degreeInfoSes")).elementAt(i+5) %><br><br>
	
<% } %>
	
<%	
	Class.forName("org.postgresql.Driver");
	Connection connect = DriverManager.getConnection("jdbc:postgresql://localhost/tester?user=postgres&password=admin");

	PreparedStatement prepStmt;
	ResultSet rset;
	prepStmt = connect.prepareStatement("SELECT * FROM specializations");
	rset = prepStmt.executeQuery();
	Vector specializations = new Vector();
	Vector specializationsID = new Vector();
	while(rset.next())
	{
		specializationsID.add(rset.getString("id"));
		specializations.add(rset.getString("specialization"));
	}
%>
	
	Please select your specialization
	
	<form method="GET" action="11_Verification.jsp">
	
	<select name="degreeSpecialization">
	
	<%
	for(int i=0; i<specializations.size(); i++)
	{ %>
		<option value="<%= specializations.get(i) %>#specializationID=<%=specializationsID.get(i) %>"> <%= specializations.get(i) %></option>
	<% } %>
	
	</select>
	
	
	<input type="submit" value="Click to Submit"/>
	</form>
	

</body>
</html>